package com.demo.图.model;

import lombok.Getter;
import lombok.Setter;

/**
 * 定义图边结构
 * @author cl
 */
@Getter
@Setter
public class Edge<T> {
    /** 权重 */
    public int weight;
    /** 起始顶点 */
    public Vertex<T> from;
    /** 终止节点 */
    public Vertex<T> to;

    public Edge() {}
    public Edge(Vertex<T> from, Vertex<T> to, int weight) {
        this.from = from;
        this.to = to;
        this.weight = weight;
    }
}
